<template>
	<view>
		<nav-bar>公共文档</nav-bar>

		<view class="search-lay">
			<view class="search_box">
				<image class="search_icon" :src="searchIconUrl"></image>
				<input v-model="strInput" class="search_tip" placeholder="输入搜索内容" confirm-type="search" @confirm="onSearchClick"></input>
			</view>
		</view>


		<documentList ref="documentList" style="height: 100%; margin-top: 24upx;" :strInput="strInput" :searchPid="searchPid">

		</documentList>

	</view>
</template>

<script>
	import uniPopup from '@/components/uni-popup/uni-popup.vue'
	import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
	import ytUploads from "@/components/yt-uploads/yt-uploads.vue"
	import documentBottomMenu from './_compoments/documentBottomMenu.vue'
	import documentList from './_compoments/documentList.vue'
	import CONSTS from '@/common/biz/consts.js'
	import Http from '@/common/http';

	import test_doclist from "@/common/test_jsons/test_doclist.js"
	import {
		searchEnterPriseDoc,
		GetOctpusEnterPriseDataList,
		DeleteEnterPriseData,
		UpdateDocEntDocName,
	} from '@/services/document.js';

	import fileUtil from "@/utils/fileUtil.js";
	import {
		mapState,
		mapMutations
	} from 'vuex';
	export default {
		computed: {
			...mapState(['userInfo'])
		},

		components: {
			uniPopup,
			uniPopupDialog,
			documentBottomMenu,
			ytUploads,
			documentList
		},

		data() {
			return {
				searchIconUrl: '/static/' + 'icon_search.png',
				changeIconUrl: '/static/' + 'icon_navigation_switch.png',
				messageIconUrl: '/static/' + 'icon_navigation_news.png',
				docIconUrl: '/static/' + 'icon_doc.png',
				pdfIconUrl: '/static/' + 'icon_pdf.png',
				clearUrl: '/static/' + 'icon_delect.png',

				searchPage: -1,
				searchPid: '0',

				strInput: '',
			}
		},

		watch: {
			selectDocIds(val) {
				if (val.length == 0) {
					this.showSelectAll = false;
				} else {
					this.showSelectAll = true;
				}
			}
		},
		methods: {
			onSearchClick() {
				this.$refs.documentList.searchListData();
			},

			onSelectAllClick() {
				uni.navigateBack({

				})
			}
		}
	}
</script>

<style scoped lang='scss'>
	.page-header {
		height: 88upx;
		background-color: #2C405A;
		z-index: 1000;
	}

	.search-lay {
		/* width: 100%; */
		background: #FFFFFF;
		box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.2);
		padding: 12upx 32upx 12upx 32upx;

	}

	.search_box {
		height: 64upx;
		background: rgba(0, 0, 0, 0.04);
		border-radius: 8px;
		filter: blur(0px);

		padding-left: 12upx;
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.search_tip {
		height: 17px;
		font-size: 12px;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #000;
		line-height: 17px;
	}

	.search_icon {
		width: 40upx;
		height: 40upx;
	}

	.right-text {
		font-size: 14px;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: rgba(0, 0, 0, 0.45);
		line-height: 20px;
		margin-right: 30upx;
	}

	.right_icon {
		width: 32upx;
		height: 32upx;
		padding: 15upx;
		border-radius: 25px;
		border: 1px solid rgba(255, 255, 255, 1.0);
		margin-right: 20upx;
		background-color: #FFFFFF;
	}

	.search-doc-lay {
		display: flex;
		flex-direction: column;
		background-color: #FFFFFF;
		height: 90vh;
	}

	.item-one {
		display: flex;
		flex-direction: row;
		padding: 30upx;
		justify-content: space-between;
	}
</style>
